package com.humanminoritygame.model.mock;

import java.util.SortedSet;
import java.util.TreeSet;

import com.humanminoritygame.model.Category;
import com.humanminoritygame.model.CategoryRepo;

public class MockCategoryRepo implements CategoryRepo{
  private SortedSet<Category> categories = new TreeSet<Category>();
  
  private MockCategoryRepo(){
    Category c1 = new Category("once a minute", 10);
    Category c2 = new Category("once a day", 20); 
    categories.add(c1);
    categories.add(c2);
  }
  
  
  @Override
  public void addCategory(Category category) {
    categories.add(category);
  }

  @Override
  public SortedSet<Category> getAllCategories() {
    return categories;
  }

  @Override
  public Category getCategoryById(Long id) {
    for(Category category : categories){
      if(category.getId() == id){
        return category;
      }
    }
    //TODO exception?
    return null;
  }

}
